from django.urls import path

from Apps.DataGeneration.views import DataArgsView, DataGenerationCatView, DataView, getCatOptions, postDataArgsView, \
    updateDataArgsView, deleteDataArgsView, updateDataArgsIsEnableView, getCatDataArgs, getFirstDataArgId

from rest_framework.routers import SimpleRouter

route = SimpleRouter()
# 获取数据分类表
route.register("dataCat", DataGenerationCatView, basename="dataCat")
# 获取数据生成参数表
route.register("dataArgs", DataArgsView, basename="dataArgs")

urlpatterns = [

                  # 新增数据类型时，获取数据分类
                  path('catOptions/', getCatOptions.as_view()),
                  # 新增
                  path('postDataArgs/', postDataArgsView.as_view()),
                  # 编辑
                  path('updateDataArgs/', updateDataArgsView.as_view()),
                  # 删除
                  path('deleteDataArgs/', deleteDataArgsView.as_view()),
                  # 更改是否可用
                  path('updateDataArgsIsEnable/', updateDataArgsIsEnableView.as_view()),

                  # 初始化时，获取第一个ID
                  path('getFirstDataArgId/', getFirstDataArgId.as_view()),

                  # 获取分类数据类型
                  path('getCatDataArgs/', getCatDataArgs.as_view()),

                  # 数据生成
                  path('data/', DataView.as_view()),

              ] + route.urls
